<?php
/**
 * Created by PhpStorm.
 * User: yf
 * Date: 2019-01-01
 * Time: 20:06
 */

return [
    'SERVER_NAME' => "EasySwoole",
    'MAIN_SERVER' => [
        'LISTEN_ADDRESS' => '0.0.0.0',
        'PORT' =>8002,
        'SERVER_TYPE' => EASYSWOOLE_WEB_SOCKET_SERVER, //可选为 EASYSWOOLE_SERVER  EASYSWOOLE_WEB_SERVER EASYSWOOLE_WEB_SOCKET_SERVER,EASYSWOOLE_REDIS_SERVER
        'SOCK_TYPE' => SWOOLE_TCP,
        'RUN_MODEL' => SWOOLE_PROCESS,
        'SETTING' => [
            'worker_num' => 8,
            'reload_async' => true,
            'max_wait_time'=>3,
            'open_tcp_keepalive' =>1,#启用tcp keepalive
            'tcp_keepidle' => 3, //4s没有数据传输就进行检测
            'tcp_keepinterval' => 1, //1s探测一次
            'tcp_keepcount' => 2, //探测的次数，超过2次后还没回包close此连接
            'heartbeat_check_interval'=>20,#连接检测间隔
            'heartbeat_idle_time'=>41,#连接最长空闲时间
        ],
        'TASK'=>['workerNum'=>4,'maxRunningNum'=>128,'timeout'=>15]
    ],
    /*################ MYSQL CONFIG ##################*/

    'MYSQL' => [
        'host'          => '192.168.2.65',
        'port'          => '3306',
        'user'          => 'sdk',
        'timeout'       => '20',
        'charset'       => 'utf8mb4',
        'password'      => 'n74pKLbYDrWGxhLN',
        'database'      => 'sdk',
        'POOL_MAX_NUM'  => '60',
        'POOL_TIME_OUT' => '0.1',
    ],



    /*################ REDIS CONFIG ##################*/

    'REDIS' => [
        'host'          => '106.52.140.176',
        'port'          => '6379',
        'auth'          => 'esgesrghergh3214',
        'POOL_MAX_NUM'  => '100',
        'POOL_MIN_NUM'  => '1',
        'POOL_TIME_OUT' => '1',
    ],

    'TEMP_DIR' => '/Temp_switchboard1',
    'LOG_DIR' =>'/Log_switchboard1',

    'QINIU'=>[
        'QINIU_ACCESS_KEY'=>'F6aESKdVKX3DUNP-qywP8Ez_tBwBiwkU3e4xHpCy',
        'QINIU_SECRET_KEY'=>'CE0J99-gsI-acW1Pd8ZlOriGzTWbdnYr9sPRePHz',
    ],

    //短信条数限制
    'SMS_CODE_LIMIT' =>5,
    //营销短信条数限制
    'SMS_MRK_LIMIT' =>3,
    'APP'=>[
        'AES'=>[
            'AES_KEY'=>'asdawsfesadfgews',
            'IV'=>'3333111111111112',
        ],
        'MASTER'=>[//中间服务器
            'host'=>'129.211.114.112:55048',
        ],
        'CLIENT'=>[//集群服务器
            [
                'host'=>'129.211.114.112:55049'
            ]

        ],
        'FILE_DOMAIN'=>'http://cdn.wangtuizhijia.com/',
        'CURRENT'=>  [//当前服务器
            'host'=>'129.211.114.112:55049',
        ]
    ],

    //聊天的配置
    'CHAT'=>[
        'online_user'=>'online_user',//在线用户集合,存在内存表
        'fd_to_user'=>'fd_to_user',//fd与user_id映射集合，存在内存表
        'fd_to_app'=>'fd_to_app',//fd与app映射集合，存在内存表
        'user_ready'=>'user_ready',#用户是否准备就绪，内存表
        'group'=>'group',//群的基础键
        'group_chat'=>'group_chat',//群聊话题
        'event_broadcast'=>'event_broadcast',#事件广播
        'sync_message'=>'sync_message',#同步消息
        'sys_message'=>'sys_message',#系统消息
        'user_offline_time'=>'user_offline_time',#用户离线时间,存在redis
        'user_token'=>'user_token',#用户token集合
    ],
    'PWD_SALT'=>'asdwfwe@35346*',//加密盐
    'UPLOAD_FOLDER'=>'upload'
];
